home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / AMarquee / include / amiga / libraries / AMarquee.h
C/C++ Source or Header  |  1998-06-24  |  4KB  |  73 lines

  1. #ifndef AMARQUEE_H
  2. #define AMARQUEE_H
  3.  
  4. #ifndef EXEC_PORTS_H
  5. #include <exec/ports.h>
  6. #endif
  7.  
  8. /* This library contains definitions and structures necessary to use amarquee.library. */
  9.  
  10. /* Different error types that can be returned to the client in QMessages */
  11. #define QERROR_NO_ERROR       0 /* Everything is okay */
  12. #define QERROR_UNKNOWN       -1 /* Don't know what the error was. */
  13. #define QERROR_MALFORMED_KEY -2 /* Keystring could not be parsed or "dir" does not exist */
  14. #define QERROR_NO_SERVER_MEM -3 /* Server did not have enough mem available to complete request */
  15. #define QERROR_NO_CONNECTION -4 /* The connection to the server went south */
  16. #define QERROR_UNPRIVILEGED  -5 /* You're not allowed to do that! */
  17. #define QERROR_UNIMPLEMENTED -6 /* Feature you requested does not exist yet */
  18. #define QERROR_NO_CLIENT_MEM -7 /* Your computer didn't have enough memory available to complete an action */
  19. #define QERROR_SYS_MESSAGE   -8 /* This message is a "wall" text message from a server admin */
  20.  
  21. /* These error types may be returned by QFreeSession() after a QSession
  22.    allocation attempt fails. */
  23. #define QERROR_NO_TCP_STACK    -20 /* TCP stack wasn't running */
  24. #define QERROR_HOSTNAME_LOOKUP -21 /* Hostname lookup of server failed */
  25. #define QERROR_ABORTED         -22 /* TCP thread got a control-C */
  26. #define QERROR_NO_SERVER       -23 /* No AMarquee server at requested host/port */
  27. #define QERROR_NO_INETD        -24 /* The program wasn't launched by inetd */
  28. #define QERROR_ACCESS_DENIED   -25 /* The server wouldn't accept our connection */
  29.  
  30. /* Flags to use with QGo() */
  31. #define QGOF_SYNC (1L<<0)     /* Send a sync packet when all has settled */
  32.  
  33. /* Flags representing special privileges; used with QRequestPrivileges(), etc */
  34. #define QPRIV_KILLCLIENTS        (1L<<0) /* license to kill! */
  35. #define QPRIV_ADMIN              (1L<<1) /* Ability to set env vars, etc, on the server */
  36. #define QPRIV_GETSYSMESSAGES     (1L<<2) /* Ability to receive special sysadmin messages */
  37. #define QPRIV_SENDSYSMESSAGES    (1L<<3) /* Ability to send special sysadmin messages */  
  38. #define QPRIV_ALL                ( 0x0F) /* all possible QPRIV_* bits */
  39.  
  40. /* All events from AMarquee come in this package! */
  41. struct QMessage 
  42. {
  43.   struct Message qm_Msg;/* Don't directly use the contents of qm_Msg! */
  44.   LONG    qm_ID;        /* Message ID # of transaction related to this opCode, or -1 if no ID is applicable. */
  45.   int     qm_Status;    /* One of the QERROR_* codes defined in AMarquee headers. */
  46.   char  * qm_Path;      /* Pathname of a node, or NULL if not applicable. */
  47.   void  * qm_Data;      /* Pointer to beginning of data buffer, or NULL if not applicable. */
  48.   ULONG   qm_DataLen;   /* Length of qm_Data buffer, or 0 if not applicable. */
  49.   ULONG   qm_ActualLen; /* Length of the data buffer stored on the AMarquee server. */
  50.   ULONG   qm_ErrorLine; /* Line # of the server source code that generated the error.  Useful for debugging. */
  51.   void  * qm_Private;   /* Private info used by FreeQMessage() */
  52. };
  53.  
  54. struct QSession
  55. {
  56.   struct MsgPort * qMsgPort;  /* Wait() on this for QMessages! */
  57.  
  58.   /********************************************************************/
  59.   /* Invisible, private info is here... don't trust sizeof(QSession)! */
  60.   /********************************************************************/
  61. };
  62.  
  63. struct QRunInfo
  64. {
  65.   LONG qr_Allowed; /* The theoretical maximum number of bytes your server may allocate. */
  66.   LONG qr_Alloced; /* The number of bytes currently allocated by your server. */
  67.   LONG qr_Avail;   /* The number of bytes that may actually be allocated by your server. */
  68.   ULONG qr_CurrentPrivs;  /* Bit-chord of QPRIV_* bits, showing what special privs you have. */
  69.   ULONG qr_PossiblePrivs; /* Bit-chord of QPRIV_* bits, showing what special privs you could get if you asked. */
  70. };
  71.  
  72. #endif
  73.